<template>
    <view class="p-left20 p-right20">
        <status-bar :title='title'></status-bar>
        <u-parse :content="content" :domain="imgUrl"></u-parse>
    </view>
</template>

<script>
export default {
    data() {
        return {
            imgUrl: this.imgUrl,
            content: '',
            title: '推广说明',
            type: 1
        }
    },
    onLoad(e) {
        if(e.type) this.type = e.type
        if(this.type == 2) {
            this.title = '门店简介'
            this.content = uni.getStorageSync('description')
            return
        }
        this.getCont()
    },
    methods: {
        getCont() {
            this.$showLoading('')
            this.$http.post({
                url: '/zzj_singleSaleApi/my_income'
            }).then(res=>{
                this.$hideLoading()
                if(res.errcode != 100) return this.$Toast(res.msg)
                if(res.data) this.content = res.data.spread_rules || ''
            })
        }
    },
    onUnload() {
        if(this.type == 2) {
            uni.removeStorageSync('description')
        }
    }
}
</script>

<style lang="less" scoped>

</style>